<%@ page language="java" import="java.util.*,com.orderMgr.bean.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%@ taglib prefix="m" uri="mytaguri"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>My JSP 'orderList.jsp' starting page</title>
  	<script type="text/javascript">
	    function del(id){
	        if(window.confirm("确实要删除吗？")){
	        	location.href="managerDelOrder.action?id="+id;
	        }
    }

    </script>

  </head>
  
  <body bgcolor="#FAFBE7">
   <center>
   <a href="getUserOrderFood.action" target="_self"><input type="button" value="全部"/></a>
     <form action="getOrderByUserName.action" method="post">
   查找用户：<input type="text" name="ordername" id="orderName"> 
    <a target="_self"><input type="submit" value="搜索用户名" /></a>
    </form>
    <form action="getOrderByFoodName.action" method="post">
 查找菜名：<input type="text" name="ordername" id="ordername"> 
     <a target="_self"><input type="submit" value="搜索菜单名"/></a>
     </form>
     
   <form action="" method="post">
   	<table border="1">
   	<tr>
   		<td>菜品名称</td>
   		<td>用户ID</td>
   		<td>用户名称</td>
   		<td>订餐时间</td>
   		<td>价格</td>
   		<td>菜馆名称</td>
   		<td>菜馆电话</td>
   		<td>操作</td>
   	</tr>
   		<m:split pageSize="10" date="${ requestScope.orderList }">
   	
   		
   		<tr>
   			<td>${dataRow.ofFoodName }</td>
   			<td>${dataRow.ofUserId}</td>
   			<td>${dataRow.ofUserName}</td>
   			<td><fmt:formatDate value="${dataRow.ofTime}" pattern="yyyy-MM-dd HH:mm:ss"/></td>
   			<td>￥${dataRow.ofFoodPrice}</td>
   			<td>${dataRow.ofRestaurantName}</td>
   			<td>${dataRow.ofTel}</td>
   			<td><a href="javascript:del(${dataRow.ofId});">删除</a></td>
   		</tr>
   		</m:split>
   		<tr>
	   		<td colspan="9">
	   			<a href='getOrderByFoodName.action?currentPage=1'>首页</a>
				<a href='getOrderByFoodName.action?currentPage=${ currentPage-1 }'>上一页</a>
				<a href='getOrderByFoodName.action?currentPage=${ currentPage+1 }'>下一页</a>
				<a href='getOrderByFoodName.action?currentPage=${ totalPage }'>尾页</a>
				${ currentPage }/${ totalPage }页
	   		</td>
   		</tr>
   		
   	</table>
   </form>
   
   </center>
  </body>
</html>
